Repository navigation
Firefox webextensions core - #11791
Conversation
extension.getBackgroundPage(), see https://bugzilla.mozilla.org/show_bug.cgi?id=1329304 Instead, we're using runtime.sendMessage() to pass messages between the popup and background page.
|
(As with #11792, just let me know when this looks good but don't merge. I'll rebase to remove the original commit as well as the revert). |
jsha
left a comment
There was a problem hiding this comment.
LGTM, modulo checking the security question below. Assuming that's resolved, feel free to merge.
| label.appendChild(favicon); | ||
| } catch (e) {} | ||
| if (favicon.src == "chrome://favicon/") { | ||
| favicon.src += "https://" + hostnames[ruleset.name]; |
There was a problem hiding this comment.
Talked in person; these lines don't work, let's remove them.
|
|
||
| // This is necessary for communication with the popup in Firefox Private | ||
| // Browsing Mode, see https://bugzilla.mozilla.org/show_bug.cgi?id=1329304 | ||
| chrome.runtime.onMessage.addListener(function(message, sender, sendResponse){ |
There was a problem hiding this comment.
Can you confirm that this will only receive messages from background.js, not from content scripts or other extensions?
There was a problem hiding this comment.
That's right. There is a separate IPC API for inter-extension, chrome.runtime.onMessageExternal. See https://developer.chrome.com/extensions/messaging#external
| if (navigator.userAgent.match("Chrome")) { | ||
| var xhr = new XMLHttpRequest(); | ||
| try { | ||
| xhr.open("GET", favicon.src, true); |
There was a problem hiding this comment.
Remove this XMLHTTPRequest stuff. I'm not sure what it was supposed to do at all.
| @@ -1,6 +1,10 @@ | |||
| var storage = chrome.storage.local; | |||
There was a problem hiding this comment.
This entire file can be deleted and replaced with simple line in each file storage is used.
const storage = chrome.storage.sync || chrome.storage.local
There was a problem hiding this comment.
Within for example the tor browser, chrome.storage.sync may exist but throw an error. That's the reason for the lastError check.
957b3ce to
0d1954a
Compare
Core changes to WebExtension code to make it work with Firefox. Reference the
donecolumn of https://github.com/EFForg/https-everywhere/projects/1